package com.baizhi.service;

import com.baizhi.dao.UserDao;
import com.baizhi.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.Set;
import java.util.UUID;

@Service
public class UserSeriviceImpl implements UserService{
    @Autowired
    private UserDao userDao;

    @Override
    public User queryOne(String name) {
        User user = userDao.selectOne(name);
        return user;
    }

    @Override
    public void insert(User user) {
        user.setId(UUID.randomUUID().toString());
        user.setStatus("1");
        user.setRegisterTime(new Date());
        userDao.add(user);
    }
}
